/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Encoder;

/**
 *
 * @author Team 1533
 */
public class EncoderDifference implements edu.wpi.first.wpilibj.PIDSource {

	Encoder master, slave;
	double balance;

	public EncoderDifference(Encoder master, Encoder slave) {
		this.master = master;
		this.slave = slave;
		balance = 1;
	}

	public double pidGet() {
		return 1 * (slave.get() - master.get()) * balance;
	}

	public void setBalance(double bal) {
		balance = bal + 1.0;
	}

	public double getBalance() {
		return balance - 1.0;
	}
}
